calculate left and right hand limits